#include <stdio.h>                                                                                                                                                                                           
#include <time.h>
#include <stdlib.h>
	   
#include "color.h"
#include "struct.h"
		     
int mode_select(num_t *num,int (*p_number_guest1)(),int (*p_number_guest2)())
{
	/*int (*p_number_guest)(num_t *num);*/
	char mode;
				     
	scanf("%s",&mode);

	while (1) {
		switch(mode) {
			case '1':
				printf(YELLOW_COLOR"当你猜数字错误时，系统将会为你提示"
						"正确数字所在的范围。\n李泽言说，猜中的话明天就来娶你哦\n"
						"按'q'退出游戏！"RESET_COLOR"\n");
						    
				srand(time(NULL));
				num->random = rand()%1000+1;

				/*p_number_guest = number_guest1;*/
				(*p_number_guest1)(num);
							    
				break;
								   
			case '2':
				printf(YELLOW_COLOR"当你猜数字错误时，系统将会为你提示"
					"所猜数字与系统随机数相同的个数\n"
					"如系统给出704，则774与之相同的数有3个\n"
					"按'q'退出游戏！"RESET_COLOR"\n");
									   
				srand(time(NULL));
				num->random=rand()%1000+1;

				/*p_number_guest = number_guest2;*/
				(*p_number_guest2)(num);
							    
				break;
											 
		default:
			printf(PURPLE_COLOR"再敲错键盘，把你家蛙崽子吊打。"RESET_COLOR"\n");
          }

		  scanf("%s",&mode);
		 
	}
	return 0;
}
